package net.techwatch.jpa.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

@Embeddable
public class Address {

	private String street;
	private String city;
	private String stateProvince;
	private Country country;
	private String postalCode;
	
	public Address() {
		// nothing to do
	}

	/**
	 * @return the street
	 */
	@Column(name="ADDRESS", nullable=false)
	public String getStreet() {
		return street;
	}

	/**
	 * @param street the street to set
	 */
	public void setStreet(String street) {
		this.street = street;
	}

	/**
	 * @return the city
	 */
	@Basic(optional=false)
	public String getCity() {
		return city;
	}

	/**
	 * @param city the city to set
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * @return the stateProvince
	 */
	@Column(name="STATE_PROVINCE")
	public String getStateProvince() {
		return stateProvince;
	}

	/**
	 * @param stateProvince the stateProvince to set
	 */
	public void setStateProvince(String stateProvince) {
		this.stateProvince = stateProvince;
	}

	/**
	 * @return the country
	 */
	@OneToOne
	@JoinColumn(name="COUNTRY_ID", referencedColumnName="COUNTRY_ID")
	public Country getCountry() {
		return country;
	}

	/**
	 * @param country the country to set
	 */
	public void setCountry(Country country) {
		this.country = country;
	}

	/**
	 * @return the postalCode
	 */
	@Column(name="POSTAL_CODE", nullable=false)
	public String getPostalCode() {
		return postalCode;
	}

	/**
	 * @param postalCode the postalCode to set
	 */
	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}
}
